<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta charset="ISO-8859-1">
    <title>选课管理系统</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <style>
        .myerr {
            width: 80px;
            font-size: xx-small;
            color: red;
        }
    </style>
</head>

<body>
<div class="container">
    <h1>选课/成绩录入管理</h1>
    <hr>
    <h2>更改/添加学生成绩</h2>
    <form action="#" th:action="@{/SC/saveSC}" th:object="${sc}" method="POST">
        <!-- Add hidden form field to handle update -->
        <input type="hidden" th:field="*{sno}"/>
        <input type="hidden" th:field="*{cno}"/>
        学号：
        <div th:text="${sc.sno}" class="form-control mb-4 col-4"></div>
        课程号：<div th:text="${sc.cno}" class="form-control mb-4 col-4"></div>
        成绩：<input type="text" th:field="*{grade}" class="form-control mb-4 col-4">
            <span th:errors="${sc.grade}" class="myerr"></span>
        <button type="submit" class="btn btn-info col-2"> 更改</button>
    </form>
    <hr>
    <a th:href="@{/SC/}"> 返回到选课/成绩列表</a>
</div>
</body>
</html>